home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MSG Graphic Effects 1.0 Source / Skipaline U-D.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-23  |  1.6 KB  |  44 lines  |  [TEXT/KAHL]

  1. /*******************************************************************************
  2.  * Copyright © 1992-1993 Mark Pilgrim                                          *
  3.  *                                                                             *
  4.  * This file is provided as is, and may be freely distributed unaltered.  This *
  5.  * message must accompany any copy of this file.  This file may be used or     *
  6.  * modified for use for a non-commercial product provided that appropriate     *
  7.  * credit is given to the author named above.                                  *
  8.  * Commercial use of this source code is prohibited.                           *
  9.  ******************************************************************************/
  10.  
  11. #include "msg misc.h"
  12. #include "msg timing.h"
  13.  
  14. #define CorrectTime 1
  15.  
  16. void Skipaline(GrafPtr);
  17.  
  18. /* Copy even-numbered rows starting at the top and moving down, and copy odd-
  19.    numbered rows starting at the bottom and moving up. */
  20.    
  21. void Skipaline(GrafPtr sourceGrafPtr)
  22. {
  23.     Rect        thisone,thatone;
  24.     
  25.     thisone.top=thisone.left=thatone.left=0;
  26.     thisone.bottom=1;
  27.     thatone.bottom=MAIN_WINDOW_HEIGHT;
  28.     thatone.top=MAIN_WINDOW_HEIGHT-1;
  29.     thisone.right=thatone.right=MAIN_WINDOW_WIDTH;
  30.     
  31.     while (thisone.top<MAIN_WINDOW_HEIGHT)
  32.     {
  33.         StartTiming();
  34.         CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
  35.             &thisone, &thisone, 0, 0L);
  36.         CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
  37.             &thatone, &thatone, 0, 0L);
  38.         thisone.top+=2;             /* even row goes down by 2 */
  39.         thisone.bottom+=2;
  40.         thatone.top-=2;             /* odd row goes up by 2 */
  41.         thatone.bottom-=2;
  42.         TimeCorrection(CorrectTime);
  43.     }
  44. }